<template>
  <div id="app">
    <GameSetup v-if="!gameStarted" @game-start="startGame" />
    <ChessBoard
      v-else
      :playerCamp="gameConfig.camp"
      :aiModel="gameConfig.model"
      :difficulty="gameConfig.difficulty"
      @quit-game="quitGame"
    />
  </div>
</template>

<script>
import GameSetup from './components/GameSetup.vue'
import ChessBoard from './components/ChessBoard.vue'

export default {
  name: 'App',
  components: {
    GameSetup,
    ChessBoard
  },
  data() {
    return {
      gameStarted: false,
      gameConfig: null
    }
  },
  methods: {
    startGame(config) {
      this.gameConfig = config
      this.gameStarted = true
    },
    quitGame() {
      this.gameStarted = false
      this.gameConfig = null
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 20px;
}
</style>
